LayoutWidget
A powerful widget used to heuristically layout out multiple element widgets in a manner akin to web DOM layout. Widgets stored in a layout can be automatically repositioned, scaled, queried, and categorized. NOTE: LayoutWidget is not a ParentElement, it is expected that you extract the elements from the layout and add them as children to a parent that contains this layout. The layout is only for positioning.
Author
fzzyhmstrs
Since
0.6.0
Parameters
Int, optional. Default 8px. The horizontal space given around the left/right edge of the layout (where the border would go visually). Unlike the DOM, there is no margin/padding duo, just padding.
Int, optional. Default whatever paddingW is. The vertical space given around the top/bottom edge of the layout (where the border would go visually). Unlike the DOM, there is no margin/padding duo, just padding.
Int, optional. Default 4. The horizontal space between elements. This can be modified per element as needed with pushSpacing and popSpacing
Int, optional. Default whatever spacingW is. The vertical space between elements. This can be modified per element as needed with pushSpacing and popSpacing
Types
Functions
Adds an element, automatically keyed off the last added element (or "" if this is the first added element).
Adds an element, keyed off a manually defined parent element.
Categorizes the elements in this layout into the three constituent components many screens/parents care about, as well as providing a method for arbitrary categorization
Same as setHeight but returns itself, and won't recompute if the layout is empty. This is often used up front to, as the name implies, clamp the allowable height of a new layout before adding elements.
Same as setWidth but returns itself, and won't recompute if the layout is empty. This is often used up front to, as the name implies, clamp the allowable width of a new layout before adding elements.
Recursively retrieves the named element. Starts with this layout's elements, then burrows into nested layouts' elements as applicable.
The horizontal padding of this layout.
The general horizontal spacing of this layout. Does not take into account the current state of the spacing stack.
The vertical padding of this layout.
The general vertical spacing of this layout. Does not take into account the current state of the spacing stack.
Returns the id of the last element added to this widget, or "" if none have been added yet
Pops a set of custom spacing off this widgets spacing stack. If all custom spacings are popped, will revert to the default spacing provided in the constructor
Push a custom element spacing to this widgets spacing stack. any elements added after this push will be spaced using the top h/w spacing on that stack, or the default spacing provided in the widget constructor if no custom spacing exists on the stack
Sets a manual width and height for this layout. Will override any automatically computed dimensions.